package com.woniu.aimd.service.impl;

import com.woniu.aimd.mapper.TeacherclassMapper;
import com.woniu.aimd.pojo.DTO.TeacherClassInfoDTO;
import com.woniu.aimd.pojo.entity.TeacherClass;
import com.woniu.aimd.service.TeacherclassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TeacherclassServiceImpl implements TeacherclassService {
    @Autowired
    private TeacherclassMapper teacherclassMapper;
    @Autowired
    private RedisTemplate redisTemplate;
    @Override
    @Cacheable(value = "getClassInfoByUserid",key = "#userId")
    public List<TeacherClassInfoDTO> getClassInfoByUserid(String userId) {
        return teacherclassMapper.getClassInfoByUserid(userId);
    }

    @Override
    public void insert(TeacherClass teacherClass) {
        teacherclassMapper.insert(teacherClass);
    }
}
